API Changes for Enterprise
To route your users' API requests to your dedicated server, all endpoints remain the same. The only change you will need to make is to add the server_id
to the payload. For example
- text2image
- image2image
- inpainting
ENDPOINT:
https://api.imagepipeline.io/sd/text2image/v1
AUTHORIZATION: API-Key
JSON BODY:
{
"model_id": "sd1.5",
"prompt": "a cute cottage in the woods, photorealisitc, 8k quality",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, deformed, blurry, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck",
"num_inference_steps": 30,
"refiner": false,
"samples": 1,
"guidance_scale": 7.5,
"width": 512,
"height": 512,
"server_id": "Your Server ID"
}
ENDPOINT:
https://api.imagepipeline.io/sd/image2image/v1
AUTHORIZATION: API-Key
JSON BODY:
{
"model_id": "sd1.5",
"init_image": "https://docs.imagepipeline.io/img/cottage.png",
"prompt": "gingerbread house with fairy lights and photorealistic finish, 8k quality",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, blurry, (unfinished objects), stock image, artifacts",
"num_inference_steps": 37,
"refiner": false,
"samples": 1,
"guidance_scale": 8.5,
"width": 512,
"height": 512,
"server_id": "Your Server ID"
}
ENDPOINT:
https://api.imagepipeline.io/sd/inpainting/v1
AUTHORIZATION: API-Key
JSON BODY:
{
"model_id": "sd1.5",
"init_image": "https://docs.imagepipeline.io/img/image_pipeline_img2img.png",
"mask_image": "https://docs.imagepipeline.io/img/mask_image.png",
"prompt": "lego batman next to the gingerbread house, photorealistic, 8k quality",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, blurry, (unfinished objects), stock image, artifacts",
"num_inference_steps": 20,
"refiner": false,
"samples": 1,
"guidance_scale": 7.5,
"width": 512,
"height": 512,
"server_id": "Your Server ID"
}
Multiple Servers
-
If you have multiple servers and want to use them to balance the client API requests, you can provide
any
forserver_id
. This will distribute the API requests between your servers efficiently. -
You can add server_id on any of the endpoints to utilize your server.